Ext.define('Trebuchet.controller.Main', {
    extend: 'Ext.app.Controller',

    init: function() {
        console.log('Initialized Users! This happens before the Application launch function is called');
    },


    Login: function(){

		try{

			//Get values from screen
			var email = Ext.get('txtEmail').getValue();
			var password = Ext.get('txtPassword').getValue();

			 $.ajax({
                url: 'http://localhost:8888/GetUsers',
                data: {
			        'email': 'email',
			        'password': 'password'
			    },
                dataType: "jsonp",
                jsonpCallback: "_getUsers",
                cache: false,
                timeout: 5000,
                success: function(data) {
                    //Ext.create('Ext.container.Viewport', {
                      //  layout: 'fit',
                        //items: [
                          //  {
                            //    title: 'Hello Ext',
                              //  html : data
                            //}
                        //]

                        console.log('Ajax Call Success');
                    },
                error: function(jqXHR, textStatus, errorThrown) {
                    
                    console.log('error ' + textStatus + " " + errorThrown);
                }
            });

		}catch(e){};


    }
});